From b076b9bbe4145eb90f15cd397325f1bf1a371a69 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 6 Sep 2005 09:44:58 +0000 Subject: [PATCH] Fix vmalloc fault path in arch/xen/i386 to correctly deal with _PAGE_PRESENT being missing from init_mm's pmd entry (*pmd_k). Signed-off-by: Jun Nakajima Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c index 431448df30..088b7e0e36 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c @@ -588,7 +588,15 @@ vmalloc_fault: pmd_k = pmd_offset(pud_k, address); if (!pmd_present(*pmd_k)) goto no_context; +#ifndef CONFIG_XEN set_pmd(pmd, *pmd_k); +#else + /* + * When running on Xen we must launder *pmd_k through + * pmd_val() to ensure that _PAGE_PRESENT is correctly set. + */ + set_pmd(pmd, __pmd(pmd_val(*pmd_k))); +#endif pte_k = pte_offset_kernel(pmd_k, address); if (!pte_present(*pte_k)) -- 2.30.2